import java.sql.Array;
import java.text.DecimalFormat;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class study {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<Integer>();
        list.add(1);
        System.out.println(list.toString());
        List<Integer> list2 = new ArrayList<Integer>();
        list2.add(2);
        list.addAll(list2);
        System.out.println(list);
        System.out.println("================Double格式化小数点后两位================");
        double test = 12345.3454312312412;
        DecimalFormat doubleFormat = new DecimalFormat("#0.00");
        String f = doubleFormat.format(test);
        System.out.println(f);
        System.out.println("================删除list最后7条数据======================");
        List<Integer> listremove = new ArrayList<Integer>();
        for (int i = 1; i <= 50; i++) {
            listremove.add(i);
        }
        System.out.println(listremove.toString());
        System.out.println("开始删除随后7条数据");
        for (int i = 1; i <= 7; i++) {
            listremove.remove(listremove.size() - 1);
        }
        System.out.println(listremove.toString());
        System.out.println("============测试datelist=============");
        LocalDate monday = LocalDate.now().minusDays(LocalDate.now().getDayOfWeek().compareTo(DayOfWeek.MONDAY));
        List<LocalDate> dateList = new ArrayList<>();
        dateList.add(monday);
        for (int i = 0; i < 7; i++) {
            dateList.add(monday.plusDays(1));
        }
        System.out.println(dateList.toString());

    }

}
